<?xml version="1.0"?>
<openerp>
	<data>
		<record id="view_pos_pos_form_applico" model="ir.ui.view">
			<field name="name">pos.order.applico</field>
			<field name="model">pos.order</field>
			<field name="inherit_id" ref="point_of_sale.view_pos_pos_form"/>
			<field name="arch" type="xml">
				<button name="action_invoice" position="replace">
					<button name="action_invoice2" string="Invoice" type="object" states="paid" attrs="{'readonly': [('partner_id','=',False)]}"/>
					<button name="action_create_invoice" string="Invoice" type="object" states="done" attrs="{'readonly': [('partner_id','=',False)]}"/>
					<button name="action_undo_invoice" string="Set To Paid/Posted" type="object" states="invoiced"/>
				</button>
				<button name="refund" position="replace">
					<button name="refund" string="Return Products" type="object" 
                           invisible="1"/>
                    <button name="cancel_order2" string="Cancel Order" type="object" 
                            attrs="{'invisible':[('state','!=','paid')]}"/>
				</button>
			</field>
		</record>

		<record id="view_pos_session_form_applico" model="ir.ui.view">
			<field name="name">pos.session.form.view.applico</field>
			<field name="model">pos.session</field>
			<field name="inherit_id" ref="point_of_sale.view_pos_session_form"/>
			<field name="arch" type="xml">
				<div class="oe_right oe_button_box" position="replace">
					<div class="oe_right oe_button_box" invisible="1">
                        <button class="oe_stat_button" name="%(point_of_sale.action_pos_box_in)d"
                            type="action" states="opened,closing_control" icon="fa-level-down">
                            <div>Put<br/>Money In</div>
                        </button>
                        <button class="oe_stat_button" name="%(point_of_sale.action_pos_box_out)d"
                            type="action" states="opened,closing_control" icon="fa-level-up">
                            <div>Take<br/>Money Out</div>
                        </button>
                    </div>
				</div>
			</field>
		</record>

        <record id="product_template_form_view_applico_pos" model="ir.ui.view">
            <field name="name">product.template.form.inherit.applico.pos</field>
            <field name="model">product.template</field>
            <field name="inherit_id" ref="point_of_sale.product_template_form_view"/>
            <field name="arch" type="xml">
            	<field name="income_pdt" position="replace">
            		<field name="income_pdt" invisible="1"/>
            	</field>
            	<field name="expense_pdt" position="replace">
            		<field name="expense_pdt" invisible="1"/>
            	</field>
            </field>
        </record>
	</data>
</openerp>
